from selenium import webdriver
from time import sleep

'''
常见的api
'''

try:
    driver = webdriver.Chrome()
    driver.get('https://www.baidu.com')
    # 窗口最大化
    driver.maximize_window()
   
    driver.find_element_by_id('kw').send_keys('天和号核心仓')
    driver.find_element_by_id('su').click()

    sleep(1)
    # 回退
    driver.back()
    sleep(1)
    # 前进
    driver.forward()
    sleep(1)
    # 刷新
    driver.refresh()



except Exception as e:
    print(e)
finally:
    sleep(2)
    # 退出浏览器
    driver.quit()
